package com.oneear.web;

import com.oneear.pojo.User;
import com.oneear.service.UserServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class UserContorller {
    @Autowired
    private UserServices userServices;
    @GetMapping("query")
    public String queryUserById(Long userid, Model model, HttpServletRequest req) throws ClassNotFoundException {
       User user = userServices.querById((long) 2);
        model.addAttribute("user", user);
        System.out.println(user);
        return "index01";


    }
}
